<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<!-- <style>
  *{ font-size:30px; margin:25px 25px}
</style> -->

<head>
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>yywangDemo</title>
  <style>
    .dbtn_accept1 {
      width: 100%;
      height: 40px;
      margin: 10px;
      border: 4px solid #e91e63;
      margin: 10px;
    }
  </style>
  <script charset="UTF-8" src="https://cdn.jsdelivr.net/npm/sa-sdk-javascript@1.19.11/sensorsdata.min.js"></script>
  <script charset="UTF-8">
    var sensors = window['sensorsDataAnalytic201505'];
    sensors.init({
      server_url: 'https://newsdktest.datasink.sensorsdata.cn/sa?project=pengyuanyang&token=5a394d2405c147ca',
      heatmap: { scroll_notice_map: 'not_collect' },
      is_track_single_page: true,
      use_client_time: true,
      send_type: 'beacon'
    });
    sensors.quick('autoTrack');

  </script>
</head>

<body>
  <input type="text" placeholder="输入搜索关键词" id="keyWord" />
  <textarea>输入内容</textarea>
  <button type="button" id="sosuo" data="test">搜索</button>

  <div id="div" name="">我是DIV2</div>
  <div class="dbtn_accept1" id="login" data-sensors-click>点击我登录</div>
  <div class="dbtn_accept1" id="openLink" data-sensors-openLink>点击唤起应用</div>
  <div class="dbtn_accept1" id="bind" data-sensors-bind>绑定事件</div>
  <div class="dbtn_accept1" id="unbind" data-sensors-unbind>解绑事件</div>
  <div class="dbtn_accept1" id="normal" data-sensors-normal>普通事件</div>
  <div class="dbtn_accept1" id="div" data-sensors-click>我是DIV3</div>
  <div class="dbtn_accept1" id="logout" data-sensors-click>点我退出登录</div>
  <script>
    document.getElementById("div").onclick = function () {
      console.log("t123456");
      sensors.track('test2_1089', {
        jww_user_id: "数学",
        $url: "https://www.baidu.com",
      });
    }

    document.getElementById("login").onclick = function () {
      sensors.login(document.getElementById("keyWord").value);
    }

    document.getElementById("logout").onclick = function () {
      sensors.logout();
    }

    document.getElementById("bind").onclick = function () {
      let content = document.getElementById("keyWord").value;
      sensors.track("$Bind", { "content": content });
    }

    document.getElementById("unbind").onclick = function () {
      let content = document.getElementById("keyWord").value;
      sensors.track("$Unbind", { "content": content });
    }

    document.getElementById("normal").onclick = function () {
      let content = document.getElementById("keyWord").value;
      sensors.track("custom", { "content": content });
    }

    // 初始化深度链接插件
    sensors.quick('useAppPlugin', {
      deeplink: function (deeplink) {
        deeplink.init({ timeout: 2900 }); // 等待唤起 App 的时间，默认 3000 ms
        document.getElementById('openLink').addEventListener('click', function (e) {
          e.preventDefault();
          deeplink.openDeepLink();
        });
      }
    });

  </script>

  <p style="height:1000px"></p>
</body>

</html>